package com.unknownman.block.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.lianziyou.chain.common.api.CommonPage;
import com.unknownman.block.mapper.TTokenSwapRecord;
import com.unknownman.block.mapper.TTokenTransRecord;
import com.unknownman.block.service.TTokenSwapRecordService;
import com.unknownman.block.mapper.TTokenSwapRecordMapper;
import java.util.List;
import java.util.Map;
import org.cloud.vo.JavaBeanResultMap;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author Administrator
 * @description 针对表【t_token_swap_record(NFT转账记录表，根据链的区块来扫描。)】的数据库操作Service实现
 * @createDate 2022-03-18 16:42:49
 */
@Service
public class TTokenSwapRecordServiceImpl extends ServiceImpl<TTokenSwapRecordMapper, TTokenSwapRecord>
    implements TTokenSwapRecordService {

    @Override
    public CommonPage<TTokenSwapRecord> findListByPage(Integer page, Integer limit, String orderBy,
        QueryWrapper<TTokenSwapRecord> queryWrapper) {

        if (StringUtils.isEmpty(orderBy)) {
            PageHelper.startPage(page, limit);
        } else {
            PageHelper.startPage(page, limit, orderBy);
        }
        List<TTokenSwapRecord> list = baseMapper.selectList(queryWrapper);
        return CommonPage.restPage(list);

    }

    @Override
    public List<JavaBeanResultMap> countSwapResultByDay(Map<String, Object> params) {
        return this.getBaseMapper().countSwapResultByDay(params);
    }
}




